#include "copycat.h"

int main( int argc, char *argv[] )
{
	if( argc !=8 )	{
		fprintf( stderr, "usage: %s  copyopt  freq-threshold  prob-threshold  trained-dir  parse tok  out-dir\n", argv[0] );
		return 1;
	}

	CUString optstr = argv[1];
	optstr.MakeToUpper();

	CCopycatTest copycat;
	if( optstr.Count( "I" ) == 1 )	{
		if( copycat.LoadInsRule( argv[4], atoi(argv[2]), atof(argv[3]) )== false )	{
			return 1;
		}
		if( copycat.ApplyInsRule( argv[5], argv[6], "RF" ) == false )	{
			return 1;
		}
	}
	else {
		if( copycat.LoadRuleRF( argv[4], atoi(argv[2]), atof(argv[3]))== false )	{
			return 1;
		}
		if( copycat.ApplyRule( argv[5], argv[6], argv[7],  "RF" ) == false )	{
			return 1;
		}
	}

	return 0;
}

